package com.youkeyi.ddy.cloud.common.api.application.system.doc;

import com.youkeyi.ddy.cloud.common.api.application.system.auth.param.SystemAuthDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.system.doc.dto.SystemDocCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.doc.dto.SystemDocListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.doc.param.SystemDocDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.system.doc.param.SystemDocListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.system.doc.param.SystemDocUploadCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * SystemDocCloudService
 *
 * @Author liuxiawang
 * @Date 2/27/23 10:47 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【SYSTEM】doc management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-SYSTEM", fallback = SystemDocCloudServiceFallback.class)
@RequestMapping("/system/doc")
public interface SystemDocCloudService {

    // 上传文件
    @ApiOperation(value = "Upload File", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.doc.SystemDocCloudService.upload")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Upload File", dataType = "SystemDocUploadCloudParam", dataTypeClass = SystemDocUploadCloudParam.class),
    })
    @PostMapping("/upload")
    public abstract SystemDocCloudDto upload(HttpServletRequest request);


    // 查询文件列表
    @ApiOperation(value = "Query System Doc List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.doc.SystemDocCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemDocListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Doc List", dataType = "SystemDocListCloudParam", dataTypeClass = SystemDocListCloudParam.class),
    })
    @GetMapping
    public abstract SystemDocListCloudDto list(SystemDocListCloudParam param);

    // 删除文件
    @ApiOperation(value = "Delete System Doc", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.doc.SystemDocCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete System Doc", dataType = "SystemDocDeleteCloudParam", dataTypeClass = SystemDocDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(SystemDocDeleteCloudParam param);
}
